package com.bigdata.demo.repository;

import com.bigdata.demo.entity.CRReport;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.stream.Stream;


@Repository
public interface CRReportRepository extends CrudRepository<CRReport,Long> {

     CRReport findById(String id_key_cr);

    @Query("select count(*)  from KKS   where kks = :kks")
    int findKKSCount(@Param("kks") String kks);

    @Query("from CRReport cr where cr.cr_equipment = ?1  ")
    List<CRReport> findCRReportsByCr_equipmentOrderByCr_dateDesc(@Param("cr_equipment") String cr_equipment);

}
